﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using TrackSystem.Entities.Extensions;
using TrackSystem.Entities.Models;


namespace TrackSystem.EntityFramework.Mapping
{
    
    public class VarMap : IEntityTypeConfiguration<VarTable>
    {
        public void Configure(EntityTypeBuilder<VarTable> builder)
        {
            builder.ToTable("var");

            builder.HasKey(s => s.Id);
            builder.HasIndex(s => s.Id).IsUnique();

            builder.Property(s => s.Name).HasMaxLength(50).IsRequired();
            builder.HasIndex(s => s.Name).IsUnique();

            builder.Property(s => s.Description).HasMaxLength(200);
        }
    }
}
